package com.handinfo.android.ui.window;

import java.io.DataInputStream;

import android.graphics.Bitmap;

import com.handinfo.android.ui.IUIWindows;
import com.handinfo.android.ui.UIWindows;
import com.handinfo.android.uicontrols.DWControlsManager;
import com.handinfo.android.uicontrols.DWListener;
import com.handinfo.android.uicontrols.controls.DWBackground;
import com.handinfo.android.uicontrols.controls.DWFrame;
import com.handinfo.android.uicontrols.controls.DWImageBox;
import com.handinfo.android.uicontrols.controls.DWTitle;
import com.handinfo.android.utils.Tools;

public class UIFamilyHappyPlace implements IUIWindows
{
	Bitmap m_cr_but = null;
	Bitmap m_cr_but_anxia = null;
	Bitmap m_cr_tit = null;
	Bitmap m_cr_tuichu = null;
	///家族福地的结算界面
	DWFrame m_happya_place_frame = null;
	DWBackground m_xbj = null;
	DWImageBox m_tit_ima;
	DWImageBox m_tuichu_ima;

	public void FamilyHappyPlace()
	{
		m_happya_place_frame = new DWFrame(DWFrame.FRAME_TYPE_HALF_HCENTER, true);
		DWControlsManager.getInstance().addControl(m_happya_place_frame);

		DWTitle m_tit = new DWTitle("", m_happya_place_frame);
		m_happya_place_frame.addControl(m_tit);

		m_tit_ima = new DWImageBox(m_cr_tit);
		m_tit_ima.setNearAnchor(m_tit, Tools.HCENTER_VCENTER, Tools.HCENTER_VCENTER, 0, 0);
		m_happya_place_frame.addControl(m_tit_ima);

		m_tuichu_ima = new DWImageBox(m_cr_tuichu);
		m_tuichu_ima.setTouchZoomIn(30, 30);
		m_tuichu_ima.setNearAnchor(m_tit, Tools.RIGHT_VCENTER, Tools.RIGHT_VCENTER, 0, 0);
		m_happya_place_frame.addControl(m_tuichu_ima);
		m_tuichu_ima.addListener(m_tuichu_lis);

		m_xbj = new DWBackground(m_happya_place_frame.getShowWidth() - 30, m_happya_place_frame.getShowHeight() - 20);

	}

	private DWListener m_tuichu_lis = new DWListener() {

		public void OnDoubleClick()
		{
		}

		public void OnClick()
		{
			DWControlsManager.getInstance().removeControl(m_happya_place_frame);
		}
	};

	public void init()
	{
		m_cr_but = UIWindows.createImage("/img/newui/anniu_6.gnp");
		m_cr_but_anxia = UIWindows.createImage("/img/newui/anniu_6ax.gnp");
		m_cr_tit = UIWindows.createImage("/img/newui/anniu_6ax.gnp");
		m_cr_tuichu = UIWindows.createImage("/img/newui/fanhuianniu_1.gnp");
	}

	public void open(byte index)
	{
	}

	public void close(byte index)
	{
	}

	public void dispose()
	{
	}

	public void logic()
	{
	}

	////读取家族的剩余人数的接收方法
	public void recvnumber(DataInputStream dis)
	{
		///移除右侧的任务列表
		UIWindows.getInstance().m_main.closeTaskList();
	}
}
